\subsection{Dirac \texorpdfstring{\( \delta \)}{𝛿} function}
First let us consider a family of functions \(D(t; \varepsilon)\) defined by
\[
	\lim_{\varepsilon \to 0} D(t; \varepsilon) = 0;\quad\forall t \neq 0
\]
\[
	\int_{-\infty}^\infty D(t;\varepsilon) \dd{t} = 1
\]
For example,
\[
	D(t; \varepsilon) = \frac{1}{\varepsilon\sqrt{\pi}}e^{\frac{-t^2}{\varepsilon^2}}
\]
We can now define the Dirac delta function \(\delta(t) = \lim_{\varepsilon \to 0} D(t; \varepsilon)\).
It has a number of interesting properties:
\begin{itemize}
	\item \(\delta(x) = 0\) for all nonzero \(x\)
	\item \(\int_{-\infty}^\infty \delta(t) \dd{t} = 1\)
	\item (sampling property) For a continuous function \(g(x)\):
	      \[
		      \int_{-\infty}^\infty g(x)\delta(x) \dd{x} = g(0)\int_{-\infty}^\infty \delta(x) \dd{x} = g(0)
	      \]
	      And more generally,
	      \[
		      \int_a^b g(x)\delta(x-x_0) \dd{x} = \begin{cases}
			      g(x_0) & a \leq x_0 \leq b \\
			      0      & \text{otherwise}
		      \end{cases}
	      \]
\end{itemize}

\subsection{Heaviside step function}
Exploiting the definition of the \(\delta\) function, we will define the Heaviside step function \(H(x)\) by
\[
	H(x) \equiv \int_{-\infty}^x \delta(t) \dd{t}
\]
Here are some of its properties:
\begin{itemize}
	\item \(H(x) = 0\) for \(x < 0\)
	\item \(H(x) = 1\) for \(x > 0\)
	\item \(H(0)\) is undefined
\end{itemize}

\subsection{Ramp function}
We define the ramp function \(r(x)\) by
\[
	r(x) \equiv \int_{-\infty}^x H(t) \dd{t}
\]
This function is shaped like a ramp:
\[
	r(x) = \begin{cases}
		0 & x < 0    \\
		x & x \geq 0
	\end{cases}
\]
These functions get `smoother' the more times we integrate.

\subsection{Delta function forcing}
Consider a linear second order ODE of the form
\begin{equation}\label{dirac2ode}
	y'' + p(x)y' + q(x)y = \delta(x)
\end{equation}
The key principle is that the highest order deriative `inherits' the level of discontinuity from the forcing term, since if any other derivative were to contain the discontinuous function, then the next higher derivative would only be more discontinuous.
So, \(y''\) behaves somewhat like \(\delta\).
Here, we will denote this \(y'' \sim \delta\)---this is extremely non-standard notation, however.

Now, since \(\delta(x) = 0\) for all nonzero \(x\), then
\[
	y''+py'+qy=0 \text{ for } x<0, x>0
\]
We will essentially have two solutions for \(y\); one for before the impulse and one after.
We need to combine these together somehow to create the resultant \(y\) solution.
But this leaves four constants of integration, so surely we can't solve it.
Luckily, \(y\) satisfies certain `jump conditions' (the analogous concept to initial conditions in this context):
\begin{itemize}
	\item \(y(x)\) is continuous at \(x=0\) because \(y'' \sim \delta \implies y' \sim H \implies y \sim r\).
	      More precisely:
	      \[
		      \lim_{\varepsilon \to 0} [y]_{x=-\varepsilon}^{x=\varepsilon} = 0
	      \]
	\item \(y'(x)\) is has a jump of 1 at \(x=0\) because \(y'' \sim \delta \implies y' \sim H\).
	      Again we can formulate this intuition more precisely by integrating \eqref{dirac2ode} around a small window \(\varepsilon\):
	      \begin{align*}
		      \lim_{\varepsilon \to 0} \int_{-\varepsilon}^\varepsilon y'' + p(x)y' + q(x)y \dd{x} & = \lim_{\varepsilon \to 0} \int_{-\varepsilon}^\varepsilon \delta(x) \dd{x} \\
		      \lim_{\varepsilon \to 0} [y']_{x=-\varepsilon}^{x=\varepsilon}                       & = 1
	      \end{align*}
\end{itemize}
As a more concrete example, let us solve
\[
	y'' - y = 3 \delta\left(x - \frac{\pi}{2}\right)
\]
where
\[
	x = 0, x = \pi \implies y = 0
\]
First, let us solve the interval \(0 \leq x < \frac{\pi}{2}\).
\begin{align*}
	y'' - y                              & = 0                                              \\
	y                                    & = Ae^x + Be^{-x}                                 \\
	\text{or } y                         & = A \sinh x + B \cosh x \text{ redefining } A, B \\
	(y = 0 \text{ at } x = 0) \implies y & = A \sinh x
\end{align*}
Similarly, between \(\frac{\pi}{2} < x \leq \pi\) (since the equation is invariant under the transformation \(x \mapsto \pi - x\)):
\[
	y = C \sinh (\pi - x)
\]
Now, we can apply two jump conditions to solve for these constants:
\begin{itemize}
	\item Integrating the differential equation over a small region:
	      \[
		      \lim_{\varepsilon \to 0} [y]_{x = \frac{\pi}{2} - \varepsilon}^{x = \frac{\pi}{2} + \varepsilon} = 3
	      \]
	      Hence, taking the derivatives of our two solutions:
	      \[
		      -A\cosh\frac{\pi}{2} - C\cosh\frac{\pi}{2} = 3
	      \]
	\item Since the \(y\) term is continuous:
	      \[
		      [y]_{x = \frac{\pi}{2} - \varepsilon}^{x = \frac{\pi}{2}} = 0
	      \]
	      \[
		      A \sinh \frac{\pi}{2} = C \sinh \frac{\pi}{2} \implies A = C
	      \]
\end{itemize}
Using both jump conditions, we have \(A = C = \frac{-3}{2\cosh \frac{\pi}{2}}\).
So our general solution is
\[
	y = \begin{cases}
		\frac{-3\sinh x}{2\cosh \frac{\pi}{2}}         & 0 \leq x < \frac{\pi}{2}   \\
		\frac{-3\sinh (\pi - x)}{2\cosh \frac{\pi}{2}} & \frac{\pi}{2} < x \leq \pi
	\end{cases}
\]
Note that often when working with limits as \(\varepsilon \to 0\), we simply elide the limit sign since it is so ubiquitous.

\subsection{Heaviside function forcing}
Consider
\begin{equation}\label{heaviside0}
	y'' + p(x)y' + q(x)y = H(x - x_0)
\end{equation}
Now, \(y(x)\) satisfies
\begin{align}
	y'' + py' + qy & = 0\quad (x<x_0) \label{heaviside1} \\
	y'' + py' + qy & = 1\quad (x>x_0) \label{heaviside2}
\end{align}
Evaluating \eqref{heaviside0} on either side of \(x_0\), we have
\[
	[y'']_{x_0^-}^{x_0^+} + p(x_0)[y']_{x_0^-}^{x_0^+} + q(x_0)_{x_0^-}^{x_0^+} = 1
\]
If \(y'' \sim H\) then \(y' \sim r\) and then \(y \sim \int r\).
Hence, \(y'\) and \(y\) are both continuous.
So our jump conditions are
\begin{itemize}
	\item \([y']_{x_0^-}^{x_0^+} = 0\)
	\item \([y]_{x_0^-}^{x_0^+} = 0\)
\end{itemize}
We can use the two initial or boundary conditions, along with the two jump conditions, to find the four constants in the solutions to \eqref{heaviside1} and \eqref{heaviside2}.
